<%@page import="com.libweb.model.dto.Member"%>
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>

    <div id="header">
    	<div class="title">
        	<a href="/libweb/">LIB WEBSITE</a>
        </div>
        <div class="links">
	       <% if(session.getAttribute("loginuser") == null) { //로그인 하지 않은 경우 %>
	            <a href="/libweb/account/loginform.action">로그인</a>
	            <a href="/libweb/member/registerform.action">회원가입</a>
	       <% }else { %>
	       		<% Member member = (Member)session.getAttribute("loginuser"); %>        
	            <% if(member.getMemberId().equals("admin")) {%>
	            		관리자님 환영합니다.
	            <% }else { %>
	            	<%= member.getMemberId() %>님 환영합니다.
	            <% } %>
	            <a href="/libweb/member/editform.action?memberid=<%=member.getMemberId()%>" >개인정보수정</a>
	            <a href="/libweb/account/logout.action">로그아웃</a>
	       <% } %>
        </div>
    </div>        
    <div id="menu">
        <div>        	
        	<% if(session.getAttribute("loginuser") == null) { //로그인 하지 않은 경우 %>
        	 	<ul>
					<li><a href="/libweb/account/loginform.action">도서 대여</a></li>
					<li><a href="/libweb/account/loginform.action">대여 관리</a></li>
					<li><a href="/libweb/board/list.action">문의 게시판</a></li>
		   		</ul>
	       <% }else { %>	
	            <% Member member = (Member)session.getAttribute("loginuser"); %>     
	            <% if(member.getMemberId().equals("admin")) {%>
	            	 <ul>
		                <li><a href="/libweb/member/list.action">회원 관리</a></li>
		                <li><a href="/libweb/book/list.action">도서 관리</a></li>
		                <li><a href="/libweb/rent/list.action?memberid=<%=member.getMemberId()%>">대여 관리</a></li>
						<li><a href="/libweb/board/list.action">문의 게시판</a></li>
		            </ul>
	            <% }else { %>
			        <ul>
						<li><a href="/libweb/book/list.action">도서 대여</a></li>
						<li><a href="/libweb/rent/list.action?memberid=<%=member.getMemberId()%>">대여 관리</a></li>
						<li><a href="/libweb/board/list.action">문의 게시판</a></li>
		            </ul>
	            <% } %>
	       <% } %>
        </div>
    </div>
    <div style="border:solid 1px;paddingL5px;text-align:right">
    [&nbsp;TOTAL : <%= application.getAttribute("total") %>&nbsp;]
    [&nbsp;CURRENT : <%= application.getAttribute("current") %>&nbsp;]       
    </div>